package sources;

import java.util.ArrayList;
import java.util.List;

public class Player {

	private List<RockPaperScissorsEnum> rockPaperScissorsList;
	private int score;

	public Player(List<RockPaperScissorsEnum> moves, int score) {
		this.rockPaperScissorsList = moves;
		this.score = score;
	}

	public Player() {
		this.rockPaperScissorsList = new ArrayList<RockPaperScissorsEnum>();
		this.score = 0;
		for (int i = 0; i < 10; i++) {
			int random = (int) (Math.random() * (2));
			switch (random) {
			case 0:
				this.rockPaperScissorsList.add(RockPaperScissorsEnum.ROCK);
				break;
			case 1:
				this.rockPaperScissorsList.add(RockPaperScissorsEnum.PAPER);
				break;
			case 2:
				this.rockPaperScissorsList.add(RockPaperScissorsEnum.SCISSORS);
				break;
			default:
				break;
			}
		}
	}

	public int getScore() {
		return score;
	}

	public void addScore() {
		this.score++;
	}

	public int getRockPaperScissorsListLength() {
		return this.rockPaperScissorsList.size();
	}

	public RockPaperScissorsEnum getNextChoice() {
		return rockPaperScissorsList.listIterator().next();
	}

}
